Size and Design a Simple HVAC System for a Vehicle Cabin
This example shows how to design a basic HVAC cooling system for a vehicle cabin (or an arbitrary closed volume).
This example was inspired by the published documentation example Model a Refrigeration Cycle, but is significantly more focused on engineering aspects and is providing more details for automotive engineers not familiar with refrigeration system design. It tries to help a mechanical or electrical engineer understand how to properly size and design a simple refrigeration loop system. Preliminary Considerations
Problem to solve:
- Assume we want to cool a vehicle cabin and its volume is 4 m^3.
- Suppose the external temperature is 30 degrees Celsius and the volume desired temperature is 22 degrees, and we want to cool down the cabin temperature in 1 min. We assume the air is dry.
- For simplicity, we assume there are no losses in the system and the cabin does not exchange heat with the surroundings.
T_env = 30; % [degC] External environment temperature
RH_env = 0.5; % External environment relative humidity
% Set nominal cooling temperature of the refrigeration system
T_set = 22; % [degC] Thermostat set point
We can estimate the heat load on the system by using following formula:
Heat Load (Q) = Volume × Density × Specific Heat × Temperature Difference
Where: Volume = 4 cubic meters
Density of air = approximately 1.225 kg/m^3
Specific heat of air = approximately 1.005 kJ/kg·°C
Temperature Difference = (Desired Temperature - External Temperature) = (22°C - 30°C)
Let's calculate: Temperature Difference = (22°C - 30°C) = -8°C
Heat Load (Q) = 4 m^3 × 1.225 kg/m^3 × 1.005 kJ/kg·°C × (-8°C) ≈ -39 kJ
Since we're dealing with cooling, the negative sign indicates heat removal. Suppose we want to cool down the volume in 1 min = 60 s. The neeeded cooling power (that is, the heat flow rate) will be
Heat Flow Rate (Q) = Heat Load (Q) kJ / 60 s ≈ 0.65 kW.
How much refrigerant mass flow rate is needed for this heat flow rate?
Assume the refrigerant as R410a. To calculate the mass flow rate, we can use the specific heat capacity of the refrigerant R410a and the heat flow rate of the refrigerant. The specific heat capacity of R410a is approximately 1.87 kJ/kg·°C.
Mass Flow Rate = Heat Flow Rate (Q)/(Specific Heat Capacity × Temperature Difference)
Given:
Heat Flow Rate (Q) = 0.65 kW
Specific Heat Capacity of R410a = 1.87 kJ/kg·°C
Temperature Difference = (Desired Temperature - External Temperature) = (22°C - 30°C) = -8°C
Let's calculate:
Mass Flow Rate = 0.65 kW /( 1.87 kJ/kg·°C × (-8°C)) ≈ 0.04 kg/s
In practice we need to assume a higher cooling capacity, to account for system losses (losses in the pipes, heat exchangers, etc.) and for cooling of additional components in addition to the cabin, for instance cooling the components of an EV car (batteries, DC/DC, inverter, motors, etc.). As an example, suppose we need a heat exchanger between R410a refrigeration loop and a water circuit, to cool the batteries used by and BEV or HEV, and we need to determine the heat transfer rate for this heat exchanger. Based on the heat transfer rate, we can select an appropriate heat exchanger design.
Calculate the Heat Transfer Rate:
Q = mdot×Cw×(Tinflow−Toutflow), where:
Q = Heat transfer rate (in kW)
mdot = Mass flow rate of water (in kg/s)
Cw = Specific heat capacity of water (in kJ/kg·°C)
Tinflow = Inflow temperature of water (in °C)
Toutflow = Outflow temperature of water (in °C)
Given: Mass flow rate of water = 0.5 kg/s
Specific heat capacity of water (Cw) = 4.186 kJ/kg·°C (at constant pressure)
Tinflow = 50°C
Toutflow = 49°C
Let's calculate Q:
Q = 0.5 kg/s × 4.186 kJ/kg/°C×(50°C−49°C)=2.09 kW
With these preliminary considerations, we can design the cooling system. To account for the cooling power needed to cool down both the cabin and the coolant fluid, we assume the nominal cooling capacity of the refrigeration system to be 3 kW.
% Cooling capacity of the refrigeration system
For a more detailed analysis, that considers air moisture and latent heat, one can refer to the Live Script Rough_design_of_a_thermal_system, which is an example of leveraging ChatGPT to quickly get a ballpark figure for the thermal system cooling power. Refrigeration Circuit Primer
Before delving into design details, here's a basic overview of the thermodynamics involved in the condenser and evaporator of a refrigeration system:
- Condenser:
- The high-pressure, high-temperature refrigerant vapor enters the condenser from the compressor.
- Heat from the hot refrigerant vapor is transferred to the surrounding air (in an air-cooled condenser) or to a cooling medium (in a liquid-cooled condenser).
- As the refrigerant releases heat, it undergoes a phase change from vapor to liquid (condensation) while maintaining high pressure.
- The condensed liquid refrigerant leaves the condenser and flows to the expansion valve.
- Evaporator:
- The low-pressure, low-temperature liquid refrigerant enters the evaporator from the expansion valve.
- Heat from the surroundings (the space to be cooled) is absorbed by the cold refrigerant liquid.
- As the refrigerant absorbs heat, it undergoes a phase change from liquid to vapor (evaporation) while maintaining low pressure.
- The vaporized refrigerant leaves the evaporator and returns to the compressor to complete the refrigeration cycle.
Key Thermodynamic Processes:
- Condensation: Heat is released from the refrigerant vapor as it condenses into a liquid. This heat transfer process occurs at constant pressure.
- Evaporation: Heat is absorbed by the refrigerant liquid as it evaporates into a vapor. This heat transfer process also occurs at constant pressure.
- Latent Heat: During both condensation and evaporation, the refrigerant undergoes a phase change while absorbing or releasing latent heat without a change in temperature.
Let's break down the explanation using enthalpy, pressure, vapor quality, and temperature for both the condenser and evaporator:
- Condenser:
- Enthalpy: Enthalpy is a measure of the total heat content of a substance. In the condenser, the high-pressure, high-temperature refrigerant vapor undergoes a decrease in enthalpy as it releases heat to the surroundings and condenses into a liquid. This process is known as the latent heat of condensation.
- Pressure: The pressure in the condenser remains relatively constant throughout the condensation process, as it is designed to maintain the refrigerant at a high pressure to facilitate heat transfer to the surroundings.
- Vapor Quality: In the condenser, the refrigerant starts as a superheated vapor with a vapor quality of 1 (100% vapor) and ends as a saturated liquid with a vapor quality of 0 (0% vapor). Vapor quality is a measure of the fraction of vapor in the refrigerant mixture.
- Temperature: The temperature of the refrigerant decreases during condensation as heat is transferred to the surroundings. However, the temperature remains relatively constant during the phase change process until all the vapor is condensed into a liquid.
- Evaporator:
- Enthalpy: In the evaporator, the low-pressure, low-temperature liquid refrigerant absorbs heat from the surroundings and undergoes an increase in enthalpy as it evaporates into a vapor. This process is known as the latent heat of evaporation.
- Pressure: The pressure in the evaporator remains relatively constant throughout the evaporation process, as it is designed to maintain the refrigerant at a low pressure to facilitate heat absorption from the surroundings.
- Vapor Quality: In the evaporator, the refrigerant starts as a saturated liquid with a vapor quality of 0 and ends as a superheated vapor with a vapor quality of 1. The vapor quality increases as more liquid evaporates into vapor.
- Temperature: The temperature of the refrigerant increases during evaporation as it absorbs heat from the surroundings. Similar to condensation, the temperature remains relatively constant during the phase change process until all the liquid is evaporated into vapor.
In summary, both the condenser and evaporator in a refrigeration system involve changes in enthalpy, pressure, vapor quality, and temperature as the refrigerant undergoes phase changes and heat transfer processes. These thermodynamic properties are crucial for understanding and designing efficient refrigeration systems.
Let's delve into the mathematics behind the thermodynamic processes in the condenser and evaporator using the basic principles of thermodynamics:
- Condenser:
- Enthalpy Change (ΔH): The enthalpy change during condensation can be calculated using the formula: ΔH=m×(hfinal−hinitial), where:
- ΔH = Enthalpy change (in kJ)
- m = Mass flow rate of refrigerant (in kg/s)
- hfinal = Enthalpy of saturated liquid refrigerant (in kJ/kg) at condenser outlet conditions
- hinitial = Enthalpy of superheated vapor refrigerant (in kJ/kg) at condenser inlet conditions
- Pressure: The pressure drop in the condenser is negligible for most practical purposes. Therefore, the pressure remains approximately constant.
- Vapor Quality (x): Vapor quality represents the fraction of vapor in the refrigerant mixture and can be calculated using: x=h-hf/(hg−hf), where:
- x = Vapor quality
- h = Enthalpy of refrigerant mixture
- hf = Enthalpy of saturated liquid refrigerant
- hg = Enthalpy of saturated vapor refrigerant
- Temperature: The temperature change during condensation is minimal due to the latent heat of condensation being absorbed by the surroundings. Therefore, the temperature remains relatively constant.
- Evaporator:
- Enthalpy Change (ΔH): The enthalpy change during evaporation can be calculated similarly to condensation:ΔH=m×(hfinal−hinitial), where:
- ΔH = Enthalpy change (in kJ)
- m = Mass flow rate of refrigerant (in kg/s)
- hfinal = Enthalpy of superheated vapor refrigerant (in kJ/kg) at evaporator outlet conditions
- hinitial = Enthalpy of saturated liquid refrigerant (in kJ/kg) at evaporator inlet conditions
- Pressure: Similar to the condenser, the pressure in the evaporator remains approximately constant.
- Vapor Quality (x): Vapor quality in the evaporator increases as more liquid evaporates into vapor, following the same formula as in the condenser.
- Temperature: The temperature change during evaporation is minimal due to the latent heat of evaporation being absorbed from the surroundings. Therefore, the temperature remains relatively constant.
These mathematical relationships help in understanding the thermodynamic processes involved in the condenser and evaporator of a refrigeration system.
Define the Operating Range of the Refrigeration Cycle
First, choose the appropriate refrigerant based on the design requirements. The example model uses R-410a refrigeration fluid.
Next, define the four points of the refrigeration cycle on a p-H diagram for that refrigerant.
To plot fluid property contours on a pressure-enthalpy diagram, right-click on a Two-Phase Fluid Predefined Properties (2P) block or a Two-Phase Fluid Properties (2P) block in a Simulink model. Select Fluids > Plot Fluid Properties (Contours). Select Enthalpy Axis in the opened figure. The p-H diagram will look like this:
Next, we define the requirements for the refrigeration cycle.
- Set the condensing temperature, or the saturation temperature in the condenser, to be higher than the outdoor temperature to enable heat transfer from the refrigerant to the outdoor environment. The example model uses a 45 °C refrigerant temperature to provide a 15 °C temperature difference with ambient.
- Set the evaporating temperature, or the saturation temperature in the evaporator, to be lower than the desired indoor temperature to enable heat transfer from the indoor air to the refrigerant. The example model uses a 5 °C evaporator outlet temperature to remove heat from the 22 °C set temperature for the cabin.
- To estimate the specific enthalpy end points of the high and low pressure lines in the cycle, set the amount of subcooling at the condenser outlet.
Based on above considerations, define operating range of the system as below:
Location | Point Number | Specific Pressure (p) | Specific Enthalpy (h) | Notes |
Evaporator outlet | 1 | 0.934 MPa | 430 kJ/kg | Corresponds to a superheat of 5 °C |
Condenser inlet | 2 | 2.734 MPa | 457 kJ/kg | Corresponds to an estimated temperature of 65 °C |
Condenser outlet | 3 | 2.734 MPa | 267 kJ/kg | Corresponds to a subcooling of 5 °C |
Evaporator inlet | 4 | 0.934 MPa | 267 kJ/kg | Corresponds to a vapor quality of 0.27 |
Visualize the operating range by plotting the 4 points on the p-H diagram:
% hold on % hold on the axes of the opened p-H plot figure
% uncomment below line to plot the refrigeration loop points
% plot([430 457 267 267 430], [0.934 2.734 2.734 0.934 0.934], 'k-o', LineWidth = 2)
We will design the system based on these 4 points. Their meaning is explained in below figure.
You can check the amount of superheat and subooling, using plot datatips.
Subcooling and superheat deltaK are around 5 °C, as defined in the requirements.
The energy balance in a refrigeration cycle involves accounting for the heat transfer into and out of each component of the system.
Here's how we can express the energy balance for each component of the cycle (for simplicity, we neglect losses):
- Compressor:
- Energy input to the compressor = Work done by the compressor
- The energy input to the compressor is equal to the enthalpy increase of the refrigerant during compression.
- Energy input to compressor = m×(hcompressor inlet−hcompressor outlet)
- Condenser:
- Heat absorbed by the condenser = Heat released by the refrigerant
- The heat absorbed by the condenser is equal to the enthalpy decrease of the refrigerant during condensation.
- Heat absorbed by condenser=m×(hcondenser inlet−hcondenser outlet)
- Expansion Valve:
- The expansion valve does not involve any heat transfer, so there is no energy balance equation for this component.
- Evaporator:
- Heat absorbed by the evaporator = Heat transferred to the refrigerant
- The heat absorbed by the evaporator is equal to the enthalpy increase of the refrigerant during evaporation.
- Heat absorbed by evaporator=m×(hevaporator outlet−hevaporator inlet)
Overall, the energy balance for the refrigeration cycle can be summarized as follows:
Energy input=Work done by compressor+Heat absorbed by condenser
Energy output=Heat absorbed by evaporator
Energy input=Energy output
By maintaining this energy balance, we can ensure a stable operation of the refrigeration cycle.
Set Up the Evaporator Test Harness
Next, we start by designing the evaporator. We use the values defined by the p-H cycle.
evap_inlet_enthalpy = 267; % kJ/kg (from p-H diagram)
evap_outlet_enthalpy = 430; % kJ/kg (from p-H diagram)
evap_inlet_p = 0.934; % MPa
evap_superheat_temp = 5; % deltaK
% Set the evaporating temperature, or the saturation temperature in the
% evaporator, to be lower than the desired cabin temperature to enable
% heat transfer from the indoor air to the refrigerant.
nominal_evap_temp = T_set -15; %degC
Next, estimate the needed mass flow rate values:
Refrigerant — Divide the cooling capacity by the difference between the evaporator outlet specific enthalpy and the evaporator inlet specific enthalpy.
Air — Divide the cooling capacity by the pressure coefficient of air, and divide that result by the desired temperature drop across the evaporator.
This example gives 10 °C, which is equivalent to a temperature drop of 10 K. Consequently, CoolingPower_kW / 1 kJ/kg/K / 10 K = 0.3 kg/s.
To calculate the volumetric flow rate, divide the mass flow rate of the air by the density of air, which gives 0.3 kg/s / 1.2 kg/m3 = 0.25 m^3/s
% calculate the mass flow rate, using the CoolingPower_kW design parameter
refrigerant_massflowrate = CoolingPower_kW/(evap_outlet_enthalpy-evap_inlet_enthalpy); % kg/s
% To calculate air massflow rate for the evaporator (that cools the cabin),
% divide the cooling capacity by the heat capacity of air at constant
% pressure, and divide that result by the desired temperature drop across
Cp_air = 1.005; % KJ/kg/K Cp heat for air
evap_temperature_drop = 10; % degC, temperature drop across the evaporator
evap_air_massflowrate = CoolingPower_kW/Cp_air/evap_temperature_drop; %kg/s
% Define refrigerant pipe and air duct diameters
tube_D = 0.01; % [m] Refrigerant tube diameter
duct_W = 0.2; % [m] Air duct width
Open the test harness model.
open_system("designEvaporator");
- Pressure specification
- Inlet condition specification
- Outlet condition specification
Use following settings in the block:
Also note the boundary conditions used for the two-phase reservoirs. They use the thermodynamic parameters defined above.
The example model uses a calculated mass airflow rate evap_air_massflowrate = 0.02 kg/s. As seen in the simulation capture below, the heat flow rate at near steady-state is very close to the design value of 3 kW, since it is 
=refrigerant_massflowrate*(evap_outlet_enthalpy-evap_inlet_enthalpy) = 3 kW. This flow rate corresponds to a temperature drop of about 10 °C across the evaporator, where the cabin temperature is 22 °C and the return air is 12 °C.
If necessary, adjust the mass flow rate on both the Mass Flow Rate Source (2P) block and the System-Level Condenser Evaporator (2P-MA) block until your model meets the conditions of your p-H diagram.
The temperature drop of about 10 °C can be checked by running the simulation and checking the Simscape results viewer.
Let's also check the p-H diagram, using the evaporator input and outlet sensors S1 and S5. We can see the evaporator works in the specified design area.
Notes:
- Choose an appropriate refrigerant tube size based on the refrigerant mass flow rate.
- Choose an appropriate air duct size based on the air flow rate.
Set Up the Thermostatic Expansion Valve Test Harness
Next, we add a Thermostatic Expansion Valve (TXV) valve to the system.
The bulb of the TXV contains a temperature-sensitive material (such as a refrigerant) that expands or contracts based on the temperature it is exposed to. This expansion or contraction of the bulb material controls the opening and closing of the TXV valve, regulating the flow of refrigerant into the evaporator coil. The bulb temperature is typically measured at the outlet of the evaporator coil. The bulb of the TXV is attached to the suction line of the refrigeration system at the outlet of the evaporator, the line which is connected to the compressor. This placement allows the bulb to sense the temperature of the refrigerant vapor leaving the evaporator. By measuring the temperature at the outlet of the evaporator, the TXV can maintain a consistent superheat level, ensuring optimal evaporator performance and preventing issues such as flooding or starving of the evaporator coil. The superheat level is the difference between the measured bulb temperature and the refrigerant saturation temperature at the evaporator outlet.
open_system("designThermostaticExpansionValve");
Note that we change the boundary conditions for the two-phase domain, to make it easy to connect later to the condenser.
% Set the condensing temperature, or the saturation temperature in the
% condenser, to be higher than the outdoor temperature to enable heat
% transfer from the refrigerant to the outdoor environment. In this case it
% is 45 ℃, which is close to the maximum temperatures encountered on our
% planet, for the moment at least.
nominal_condens_temp = T_env + 20; % degC
% Set a subcooling temperature of 5 deg
condenser_subcooling_temp = 5; % deltaK
The TXV valve is parametrized as below, using the system design parameters (heat flow rate and temperatures):
Set Up the Condenser Test Harness
Next, we design and test the condenser.
open_system("designCondenser");
Note the options used for:
- Pressure specification
- Inlet condition specification
- Outlet condition specification
Also, note the boundary conditions used for the two-phase domain (Reservoir (2P) block).
Set condenser parameters as below.
condenser_inlet_temp = 65; %degC
condenser_inlet_enthalpy = 457; % kJ/kg (from p-H diagram)
condenser_inlet_p = 2.734; % MPa (from p-H diagram)
condenser_outlet_enthalpy = 267; % kJ/kg (from p-H diagram)
% Mass flow rate for the condenser fan (design parameter)
condenser_air_massflowrate = 1.5; % kg/s
% Compressor nominal speed
RPM_Compressor_nominal = 1000; % rpm
The compressor block is parametrized as below:
Check the temperatures of the Thermodynamic Properties Sensor (2P) blocks at the condenser inlet and evaporator outlet. Since the compressor does work on the refrigerant, the inlet temperature should be higher than the outlet.
Adjust the Nominal inlet temperature parameter in the System-Level Heat Exchanger (2P) block. Note that the condenser inlet and outlet specific enthalpy match the specific enthalpy end points of the high and low pressure lines in the cycle on the p-H diagram from step 1. Because the boundary conditions in the reservoir match the nominal operating conditions in the System-Level Heat Exchanger (2P-MA) block and the initial conditions of the System-Level Heat Exchanger (2P-MA) are the same as the nominal operating conditions, the simulation of the test harness model should be close to steady state.
The p-H diagram for the condenser model, using the condenser input and outlet sensors S2 and S3 (check the model). We can see the condenser works in the specified design area.
Check that the rate of heat transfer in the condenser is close to the combined rate of heat transfer in the evaporator and the fluid power in the compressor (in an open-loop configuration the values might be different from a closed-loop, but not very much).
This is important to ensure that the closed-loop system has negligible net energy transfer, which prevents pressure divergence.
Note that the compressor mechanical power is higher due to the compressor losses (calculated using the efficiency parameter in the compressor model).
If necessary, adjust the air mass flow rate on both the Mass Flow Rate Source (MA) block and the System-Level Condenser Evaporator (2P-MA) block parameters to safely reject heat from the condenser. The example model uses a volumetric flow rate of 1.5 m3/s. This flow rate results in an air temperature rise of about 10 °C across the condenser, from 30 °C to 40 °C.
Create a Model of the Open-Loop System
Next, we connect the condenser, evaporator, and TXV.
We also add a refrigeration tank to store the fluid.
open_system("refrigerationOpenLoop");
During simulation, use the p-H plot to check the design.
The refrigeration loop should be close to what we designed in the beginning (remember the 4 points we used to design the system). Note that, being an open-loop simulation, the system may not reach steady-state.
Check that the rate of heat transfer in the condenser is close to the combined rate of heat transfer in the evaporator and the fluid power in the compressor (in an open-loop configuration the values might be different from a closed-loop, but not very much).
Check it evaporator is still able to cool down the cabin air. The temperature difference should be equal to 10 degrees, as specified in the design.
Create a Model of the Closed-Loop System
open_system("refrigerationClosedLoop.slx");
During simulation, use the p-H plot to check the design.
The refrigeration loop should be close to what we designed in the beginning (remember the 4 points we used to design the system).
Check that the rate of heat transfer in the condenser is approximately equal to the combined rate of heat transfer in the evaporator and the compressor fluid power.
This is important to ensure that the closed-loop system is stable and to prevent pressure divergence.
Remember that the condenser needs to do more work than the evaporator because it must compensate for the power added by the compressor (in the p-H plot, H2-H3 = (H1-H4) + Compressor work).
This concludes our demo.
Next, we will expand the simple refrigeration loop system with additional components, for instance the vehicle cabin, and a chiller that interfaces with a water-based cooling circuit, creating a more realistic model of a vehicle thermal management system. This model can be used to properly size the system various components. Check the VehicleThermalSystemSizing Live Script and model for more details. References
- Model a Refrigeration Cycle
Copyright 2024 The MathWorks, Inc.